package com.itheima.tilas.controller;

import com.itheima.tilas.Utils.ResultUtil;
import com.itheima.tilas.service.TestInsertDeptServiceOne;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试事务的传播
 */
@RestController
@RequestMapping("/test")
public class TestTranscationController {

    @Resource
    TestInsertDeptServiceOne one;

    @GetMapping
    public ResultUtil test(){
        int i = one.insertDeptOne();
        return ResultUtil.success(i);
    }
}
